ajRabbitMQSendMessages function
Available since AlchemyJ v5.0
Description
The ajRabbitMQSendMessages function sends message(s) to RabbitMQ server. Please take note that to run this function from Excel, you would need to set up the RabbitMQ Connection in ##ExternalResources.
Syntax
ajRabbitMQSendMessages(exchange_name_list,routing_key_list,message_list,[props],[sync],[timeout],[amqp_connection_id],[run_condition],[run_by_function_point_only])
Argument Name | Argument Type | Description |
---|---|---|
exchange_name_list (required) | Range | The exchange name for the RabbitMQ message. |
routing_key_list (required) | Range | The routing_key for the exchange. |
message_list (required) | Range | The content for the message from a range of cells. The range of cells can be span across multiple rows and columns. The values of all columns in one row will be concatenated, each row represents one message. |
props (optional) | Range | The message properties, such as content type, headers, delivery mode, priority, and more. |
sync (optional) | Boolean | If it equals TRUE, it will wait RabbitMQ finish the send action. If it equals FALSE, it will not wait RabbitMQ finish the send action. The default value is FALSE. |
timeout (optional) | Integer | The timeout time (millisecond) if sync is True. |
amqp_connection_id (optional) | String | The parameter is used to define which RabbitMQ shall be executed for the function. The default value is primary. |
run_condition (optional) | Boolean | The function will run when the value is TRUE. Otherwise, it will not run. The default value is TRUE. |
run_by_function_point_only (optional) | Boolean | If it equals FALSE, the function can be executed through ‘Excel Calculation’ (can be either Automatic or Manual, Calculate Now or Calculate Sheet) or Preview Function Point. If it equals TRUE, the function can be executed with Preview Function Point (AlchemyJ ribbon \ Preview Function Point) only. The default value is TRUE. |
The function will return:
1) Return Value: TRUE / FALSE + Error Message / #VALUE!
2) Return Type: Single Value / Multiple values (array formula)
Prerequisite
Setup the RabbitMQ connection in ##ExternalResources.
Example
- Make sure the AlchemyJ Function Proxy was started up when executing ajRabbitMQSendMessages in the AlchemyJ workbook. You can start the proxy from More Tools - Run AlchemyJ Function Proxy.
- Send messages to RabbitMQ server. All result returned TRUE means the messages have been delivered successfully.
{=ajRabbitMQSendMessages(B1:B3,B4:B6,B7:B9,,,,B13,B14,B15)}
The messages can be retrieved in the defined RabbitMQ server.
When any of the message send failed it will return FALSE with error message, and other send successful messages will return TRUE.
Error Scenarios
It will return #VALUE! when missing any required parameter or mismatch parameter type in all records. Besides, system will raise error for below scenario(s).
Error Scenario |
---|
The RabbitMQ server connection is timeout. |
The size of exchange_name_list, routing_key_list, message_list are different. |
RabbitMQ connection does not exist. |
Both of records exchanges are empty. |
Both of records messages are empty. |